package com.p595263720.o_amap.map.models;

import android.graphics.Color;

import com.amap.api.maps.AMap;
import com.amap.api.maps.model.MyLocationStyle;

public class UnifiedMyLocationStyle {
    // todo 实现自定义的图标
    /// 当前位置的图标
    private String myLocationIcon;
    /// 锚点横坐标方向的偏移量
    private float anchorU;
    /// 锚点纵坐标方向的偏移量
    private float anchorV;
    /// 圆形区域（以定位位置为圆心，定位半径的圆形区域）的填充颜色值
    private String radiusFillColor;
    /// 圆形区域（以定位位置为圆心，定位半径的圆形区域）边框的颜色值
    private String strokeColor;
    /// 圆形区域（以定位位置为圆心，定位半径的圆形区域）边框的宽度
    private float strokeWidth;
    /// 我的位置展示模式
    private int myLocationType;
    /// 定位请求时间间隔
    private long interval;
    /// 是否显示定位小蓝点
    private boolean showMyLocation;

    public void applyTo(AMap map) {
        map.setMyLocationEnabled(showMyLocation);
        map.setMyLocationStyle(new MyLocationStyle()
                .anchor(anchorU, anchorV)
                .myLocationIcon(null)
                .radiusFillColor(Color.parseColor("#" + radiusFillColor))
                .strokeColor(Color.parseColor("#" + strokeColor))
                .myLocationType(myLocationType)
                .interval(interval)
                .showMyLocation(showMyLocation));

    }
}
